<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2020/9/4
  Time: 16:09
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>购物车</title>
    <%-- 静态包含 base标签、css样式、jQuery文件 --%>
    <%@ include file="/pages/common/head.jsp"%>

</head>
<body>

<div id="header">
    <span class="wel_word">订单详情</span>

    <%--静态包含，登录 成功之后的菜单 --%>
    <%@ include file="/pages/common/login_success_menu.jsp"%>


</div>

<div id="main">
    <div style="float: right"><a href="orderServlet?action=queryAllOrders">订单管理</a></div>
    <table>
        <tr>
            <td>商品名称</td>
            <td>数量</td>
            <td>单价</td>
            <td>金额</td>
        </tr>
            <c:set scope="page" var="totalcount" value="0"></c:set>
            <c:set scope="page" var="totalprice" value="0"></c:set>
            <c:forEach items="${requestScope.orderitems}" var="item">
               <c:set scope="page" var="totalcount" value="${totalcount+item.count}"></c:set>
               <c:set scope="page" var="totalprice" value="${totalprice+item.totalPrice}"></c:set>
                <tr>
                    <td>${item.name}</td>
                    <td>${item.count}</td>
                    <td>${item.price}</td>
                    <td>${item.totalPrice}</td>
                </tr>
            </c:forEach>

    </table>
    <div class="cart_info">
            <span class="cart_span">订单中共有<span class="b_count">${pageScope.totalcount}</span>件商品</span>
            <span class="cart_span">总金额<span class="b_price">${pageScope.totalprice}</span>元</span>

    </div>
</div>

<%--静态包含页脚内容--%>
<%@include file="/pages/common/footer.jsp"%>

